<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<script type="text/javascript">
$(function() {
	    $.extend($.fn.validatebox.defaults.rules, {
	    	minLength: {
			validator: function(value, param){
					return value.length >= param[0];
				},
				messbirthday: '请输入至少{0}个字符.'
		    }
		});
		
        $('#financeEditForm').form({
            url : '${path }/app/finance/save',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为leaguer.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    var form = $('#financeEditForm');
                    parent.$.messager.alert('提示', eval(result.msg), 'warning');
                }
            }
        });
    });
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" title="" style="padding: 3px;">
        <form id="financeEditForm" method="post">
            <table class="grid">
                <tr>
                    <td>收支事项名称</td>
                    <td><input name="id" type="hidden"  value="${finance.id}">
                    <input name="itemName" type="text"  placeholder="请输入名称" class="easyui-validatebox" data-options="required:true"   value="${finance.itemName}"></td>
                    <td>金额</td>
                    <td><input name="sum" type="text" placeholder="请输入金额" class="easyui-validatebox" data-options="required:true"  value="${finance.sum}"></td>
                </tr>
                <tr>
                    <td>创建时间</td>
                    <td><input type="text" name="createDate" class="easyui-validatebox" data-options="required:true" onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd'})"   value="${finance.createDate}"/></td>
                    <td>收支类型</td>
                    <td>
		              <input type="radio" name="type" id="status1" <c:choose> <c:when test="${empty finance.type}"> checked="checked" </c:when></c:choose> <c:choose> <c:when test="${finance.type== '1'}"> checked="checked" </c:when></c:choose>  value="1"style="bottom: 0px; height: 16px" />
					  <label for="status1">
						收入
					  </label>
					  <input type="radio" name="type" id="status0" value="0" <c:choose> <c:when test="${finance.type== '0'}"> checked="checked" </c:when></c:choose>   
						style="bottom: 0px; height: 16px" />
					  <label for="status0">
						支出
					  </label>
		            </td>
                </tr>
                <tr>
                    <td>操作员</td>
                    <td><input  id="operator" name="operator" value="${finance.operator}" class="easyui-validatebox"/></td>
                    <td>录入人</td>
                    <td><input type="text" name="userName" class="easyui-validatebox"   value="${userName}"/></td>
                </tr>
                <tr>
                   <%--  <td>录入时间</td>
                    <td>
                        <input type="text" name="insertTime" class="easyui-validatebox" data-options="required:true" onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd'})" value="${finance.insertTime}"/>
                    </td> --%>
                    <td>状态</td>
                    <td><select id="leaguerEditStatus" name="status" class="easyui-combobox" data-options="width:140,editable:false,panelHeight:'auto'">
                            <option value="1" <c:choose> <c:when test="${finance.status== '1'}"> selected="selected" </c:when></c:choose>>正常</option>
                            <option value="0" <c:choose> <c:when test="${finance.status== '0'}"> selected="selected" </c:when></c:choose>>停用</option>
                    </select></td>
                </tr>
                <tr>
                	<td>备注</td>
                    <td colspan="3">
                        <textarea rows="3" cols="3" style="width: 100%;" name="remarks">${finance.remarks}</textarea>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>